<?php
/**
 * lsys task
 * @author     Lonely <shan.liu@msn.com>
 * @copyright  (c) 2017 Lonely <shan.liu@msn.com>
 * @license    http://www.apache.org/licenses/LICENSE-2.0
 */
namespace LSYS\Cron\Runer;
use LSYS\Cron\Runer;

class Command implements Runer{
	protected $_command;
	public function __construct($command){
		$this->_command=$command;
	}
	public function run(){
		if (DIRECTORY_SEPARATOR=='\\') $c=$this->_command."> /dev/null &";
		else $c=$this->_command;
		system($c);
	}
	public function serialize () {
		return $this->_command;
	}
	/**
	 * @param serialized
	 */
	public function unserialize ($serialized) {
		$this->_command=$serialized;
	}
}